package com.titan.core.utils.dbinfo.dialect;

import com.titan.core.utils.dbinfo.dialect.impl.MSSQLDialect;
import com.titan.core.utils.dbinfo.dialect.impl.MySQLDialect;
import com.titan.core.utils.dbinfo.dialect.impl.OracleDialect;

/**
 * @author 周成功
 * @email 86898837@qq.com
 * @date 2020年02月14日
 */
public enum DBDialect {
    ORACLE(Integer.valueOf(1), new OracleDialect())
    ,MSSQL(Integer.valueOf(3), new MSSQLDialect())
    ,MYSQL(Integer.valueOf(2), new MySQLDialect())
    ,H2(Integer.valueOf(4), new com.titan.core.utils.dbinfo.dialect.impl.H2Dialect())
    ,MARIADB(Integer.valueOf(5), new com.titan.core.utils.dbinfo.dialect.impl.MariaDBDialect())
    ;
    
    
    private Integer type;       // 数据库类型
    private IDBDialect dialect;  // 数据库方言类
    private DBDialect(Integer type, IDBDialect dialect) {
        this.type = type;
        this.dialect = dialect;
    }
    
    public IDBDialect get() {
        return dialect;
    }
}
